#include <iostream>
#include <sstream>
#include <bitset>
#include <cstdlib>
#include <stdio.h>
using namespace std;

int main() {
	long number = 0;
	while(scanf("%li",&number) != EOF) {
		bool ret = false;
		//cout << "num: " << number << endl;
		if(number == 0) {
			scanf("%*[^\n]");
			getc(stdin);
			continue;	
		} else if(number == 1) {
			ret = true;
			scanf("%*[^\n]");
			getc(stdin);
		} else {
			long counter = number;
			long prev, cur;
			prev = cur = 0;
			bitset<3001> hash;
			bitset<3001> value;	
			//bitset<32> hash;
			//bitset<32> value;
			short mask = 0;
			while(counter > 0) {
				if(counter == number) {
					scanf("%li",&cur);
				} else {
					prev = cur;
					scanf("%li",&cur); 
					long index= abs(prev - cur)-1;
					if(index < 0 || index > (number-2) || hash.test(index) == true) {
						//cout << " Counter: "  << counter <<" index: " << index << endl;
						ret = false;
						scanf("%*[^\n]");
						getc(stdin);
						goto DONE;
					} else {
						hash.set(index);	
					}
					value.set(mask);
					mask++;
				}	
				counter--;
			}
			ret = (hash == value);
			//cout << "Hash:  " << hash.to_string() << endl;
			//cout << "Value: " << value.to_string() << endl;
		}
DONE:
		ret ? (cout << "Jolly" << endl) : (cout << "Not jolly" << endl);
	}
	return 0;	
}
